import Main from '../views/Main'

export const publicRouter = [
    {
        path: '/',
        redirect: '/room',
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/login.vue')
    },
    {
        path: '/403',
        meta: {
            title: '403-权限不足'
        },
        name: 'error-403',
        component: () =>
            import('@/views/error-page/403.vue')
    },
    {
        path: '/500',
        meta: {
            title: '500-服务端错误'
        },
        name: 'error-500',
        component: () =>
            import('@/views/error-page/500.vue')
    },
    {
        path: '/locking',
        name: 'locking',
        component: () =>
            import('@/views/main-components/lockscreen/components/locking-page.vue')
    }
]


export const appRouter = [
    {
        path: '/dataManager',
        title: "数据管理",
        name: 'dataManager',
        icon: 'ios-gear',
        component: Main,
        children: [
            {
                path: '/room',
                title: "房间状态",
                icon: 'android-menu',
                name: 'room',
                component: () => import('../views/hotel/room-list.vue')
            },
            {
                path: '/history',
                title: "历史查询",
                icon: 'ios-people',
                name: 'history',
                component: () => import('../views/hotel/history-list.vue')
            },
            {
                path: '/roomManager',
                title: "房间管理",
                icon: 'ios-gear',
                name: 'roomManager',
                component: () => import('../views/hotel/room-manager.vue')
            },
        ]
    }
]

export const routers = [
    ...appRouter,
    ...publicRouter
];
